#include "junix.h"
using namespace std;

class A {
	public:
		A(){ }
		virtual void f() = 0;
};

class B : public A {
	public:
		void f() {
			cout<<"B::f()"<<endl;
		}
};

class C : public A {
	private:
		A *a_;
	public:
		void f() {
			a_  = new B;
			a_->f();
		}
};

int main(int argc, char **argv)
{

	A *pa = new C;
	pa->f();
}
